package com.woniuxy.third.mapper;

import com.woniuxy.third.entity.User;
import com.woniuxy.third.entity.UserCollection;
import com.woniuxy.third.entity.UserCourse;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.math.BigDecimal;
import java.util.List;

/**
 * @Author: yangtao
 * @date 2021/7/19 15:01
 * @Version 1.0
 */
@Mapper
public interface UserMapper {
    public User findByAccount(String account);

    User findById(int id);

    int updateBalance(@Param("id") int id, @Param("balance") BigDecimal subtract);

    boolean updateUser(User user);

    boolean delMyCourseByUidCid(@Param("uid")int uid,@Param("cid")int cid);

    boolean addMyCourseByUidCid(@Param("uid")int uid,@Param("cid")int cid);

    boolean delMyCollectionByUidCid(@Param("uid")int uid,@Param("cid")int cid);

    boolean addMyCollectionByUidCid(@Param("uid")int uid,@Param("cid")int cid);

    List<UserCollection> findMyCollectionByUid(int uid);

    List<UserCourse> findMyCourseByUid(int uid);
}
